<?php
	require_once('inc.config.php');
	
	$action = $_REQUEST["action"];

	if($action=="add"){
		$result = $myMessage->addOneMessage();
		echo $result;
		exit;
	}else if($action == "read"){
		$result = $myMessage->readOneMessage($_GET["mid"]);
		echo $result;
		exit;
	}else if($action=="delete"){
		$result = $myMessage->deleteOneMessage($_GET["mid"]);
		if($result=="success"){
			if(__user_prop__==0){
				header("Location:agent_admin_msglist.php");
				exit;
			}else{
				header("Location:user_admin_msglist.php");
				exit;
			}
		}
	}
	
	if($result=="success"){
		header("Location:index.php");
		exit;
	}
?>